using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace backend.Models.Dtos
{
    public class InfoDto
    {
        [JsonPropertyName("type")]
        public string Type { get; set; } = null!;  // 可以为 "location" | "job" | "fault"
        [JsonPropertyName("infoID")]
        public string InfoID { get; set; } = null!; // 可以为 "location" | "job" | "fault"

        [JsonPropertyName("newArea")]
        public string? NewArea { get; set; }  // 新增的大区域

        [JsonPropertyName("area")]
        public string? Area { get; set; }  // 大区域ID，用于新增小区域时关联大区域

        [JsonPropertyName("newLocation")]
        public string? NewLocation { get; set; }  // 新增的小区域

        [JsonPropertyName("newJob")]
        public string? NewJob { get; set; }  // 新增的工种

        [JsonPropertyName("newFault")]
        public string? NewFault { get; set; }  // 新增的故障类型

        [JsonPropertyName("faultHandledBy")]
        public string? FaultHandledBy { get; set; }  // 故障类型对应的工种ID
    }

    public class DeleteInfoDto
    {
        [JsonPropertyName("type")]
        public string? Type { get; set; }  // 可以为 "location" | "job" | "fault"

        [JsonPropertyName("area")]
        public string? Area { get; set; }  // 大区域ID，用于删除小区域或整个大区域

        [JsonPropertyName("location")]
        public string? Location { get; set; }  // 小区域ID，用于删除特定小区域

        [JsonPropertyName("job")]
        public string? Job { get; set; }  // 工种ID，用于删除工种

        [JsonPropertyName("fault")]
        public string? Fault { get; set; }  // 故障类型ID，用于删除故障类型
    }

    public class ZoneDto
    {
        public string Value { get; set; } = null!;
        public string Label { get; set; } = null!;
        public List<ZoneDto> Children { get; set; } = new List<ZoneDto>();
    }

    public class ProfessionDto
    {
        public string Value { get; set; } = null!;
        public string Label { get; set; } = null!;
    }

    public class FailureDto
    {
        public string Value { get; set; } = null!;
        public string Label { get; set; } = null!;
        public bool IsStopUsing { get; set; }
    }
}